import { HTTP_METHOD } from "ajaxPath/config";
import { reqHandle } from "ajaxPath/index";

/**
 * 请求数据类型isSerializerParams：
 * true：'application/x-www-form-urlencoded;charset=utf-8'
 * false：'application/json;charset=utf-8'
 */
const prefix = "";

export default {
  // 用户登录
  getLogin: params =>
    reqHandle(`${prefix}/account/login`, {
      method: HTTP_METHOD.POST,
      isSerializerParams: false,
      params
    }),
  //用户注册
  getregister: params =>
    reqHandle(`${prefix}/account/register`, {
      method: HTTP_METHOD.POST,
      isSerializerParams: false,
      params
    }),

  // 根据锚点获取行业
  getIndustryByAnchor: params =>
    reqHandle(`${prefix}/fakuma/industry/${params.language}/${params.anchor}`, {
      method: HTTP_METHOD.GET,
      isSerializerParams: false,
      params
    }),
  // 获取行业列表
  getIndustryList: params =>
    reqHandle(`${prefix}/fakuma/industry/${params.langeuage}/list`, {
      method: HTTP_METHOD.GET,
      isSerializerParams: false,
      params
    }),
  // 获取行业案例列表
  getCaseList: params =>
    reqHandle(`${prefix}/fakuma/industry/${params.langeuage}/case`, {
      method: HTTP_METHOD.GET,
      isSerializerParams: false,
      params
    }),
  // 收藏行业案例
  collectCaseList: params =>
    reqHandle(`${prefix}/fakuma/industry/case/${params.caseId}/favourite`, {
      method: HTTP_METHOD.GET,
      isSerializerParams: false,
      params
    }),
  // 获取楼层
  getFloorList: params =>
    reqHandle(`${prefix}/Layer/list`, {
      method: HTTP_METHOD.GET,
      isSerializerParams: false,
      params
    }),
  //获取专家列表
  getExpertsList: params =>
    reqHandle(`${prefix}/expert/list`, {
      method: HTTP_METHOD.GET,
      isSerializerParams: false,
      params
    }),
  getScheduleList: (params, language) =>
    reqHandle(`${prefix}/fakuma/schedule/${language}/all`, {
      method: HTTP_METHOD.GET,
      isSerializerParams: false,
      params
    }),
  //个人信息
  getInformation: params =>
    reqHandle(`${prefix}/account/information`, {
      method: HTTP_METHOD.GET,
      isSerializerParams: false,
      params
    }),
  //个人信息-我的收藏
  getProductList: (params, language) =>
    reqHandle(`${prefix}/account/favourite/product/${language}`, {
      method: HTTP_METHOD.GET,
      isSerializerParams: false,
      params
    }),
  //个人信息-修改密码
  getmodify: params =>
    reqHandle(`${prefix}/account/password/modify`, {
      method: HTTP_METHOD.POST,
      isSerializerParams: false,
      params
    }),
  // 发送验证码
  sendCode: params =>
    reqHandle(`${prefix}/check-code/send`, {
      method: HTTP_METHOD.POST,
      isSerializerParams: false,
      params
    }),
  // 搜索产品
  getProductSearch: (params, language) =>
    reqHandle(`${prefix}/product/${language}/search/${params}`, {
      method: HTTP_METHOD.GET,
      isSerializerParams: false
    }),
  // 搜索产品详情
  getProductDetail: (params, language) =>
    reqHandle(`${prefix}/product/${language}/${params}`, {
      method: HTTP_METHOD.GET,
      isSerializerParams: false
    }),
  // 产品收藏
  favourite: (params, params2) =>
    reqHandle(`${prefix}/product/favourite/${params}?isFavourite=${params2}`, {
      method: HTTP_METHOD.POST,
      isSerializerParams: false
    }),
  //获取视频分类列表
  getVideoTypes: params =>
    reqHandle(`${prefix}/video/types`, {
      method: HTTP_METHOD.GET,
      isSerializerParams: false,
      params
    }),
  //视频列表 https://showroom.chinacloudsites.cn/api/video/en/3
  getVideoList: (language, videoType, params) =>
    reqHandle(`${prefix}/video/${language}/${videoType}`, {
      method: HTTP_METHOD.GET,
      isSerializerParams: false,
      params
    }),
  //
  // 搜索日程
  getScheduleSearch: (params, language) =>
    reqHandle(`${prefix}/fakuma/schedule/${language}/search/${params}`, {
      method: HTTP_METHOD.GET,
      isSerializerParams: false
    }),
  //找回密码
  resetCode: params =>
    reqHandle(`${prefix}/account/password/reset`, {
      method: HTTP_METHOD.POST,
      isSerializerParams: false,
      params
    }),
  // 获取历史墙
  getHistoryWall: params =>
    reqHandle(`${prefix}/history-wall/${params.language}/${params.anchor}`, {
      method: HTTP_METHOD.GET,
      isSerializerParams: false,
      params
    })
};
